
* Filepath to output folder ( <directory>/calibration/output )
global outputfilepath = "<REPLICATION PACKAGE FOLDER HERE>/calibration/output"


clear all

input MEC_MNOK dP_sim
	0.000	   .
0.0100000000000000	-0.0532106421284257
0.0200000000000000	-0.0370074014802961
0.0225000000000000	-0.0346069213842769
0.0250000000000000	-0.0324064812962593
0.0275000000000000	-0.0306061212242449
0.0300000000000000	-0.0290058011602320
0.0310000000000000	-0.0286057211442288
0.0320000000000000	-0.0280056011202240
0.0330000000000000	-0.0274054810962192
0.0350000000000000	-0.0264052810562112
0.0400000000000000	-0.0244048809761952
0.0450000000000000	-0.0228045609121824
0.0500000000000000	-0.0214042808561712
0.0550000000000000	-0.0202040408081616
0.0600000000000000	-0.0192038407681536
0.0650000000000000	-0.0182036407281456
0.0700000000000000	-0.0176035207041408
0.0750000000000000	-0.0168033606721344
0.0800000000000000	-0.0164032806561312
0.0850000000000000	-0.0158031606321264
0.0900000000000000	-0.0154030806161232
0.0950000000000000	-0.0150030006001200
0.100000000000000	-0.0146029205841168

end

gen MEC_1k = MEC * 1000

global coef = -26.55/(100*10) /* Divide by 100*10 to get effect of 10 bp shock */
global coef_lb = (-26.55-1.96*3.12)/(100*10)
global coef_ub = (-26.55+1.96*3.12)/(100*10) 

capture drop coef*
gen coef = $coef
gen coef_lb = $coef_lb
gen coef_ub = $coef_ub

set scheme s2mono, permanently
#delimit;
			twoway 	( mspline dP_sim MEC_1k , lcolor(blue)  lpattern(solid) bands(50))
					( line coef MEC_1k , lcolor(gray%80) lpattern(longdash) lwidth(medthick)  ) 
					( rarea coef_ub coef_lb MEC_1k , color(gray%10) lcolor(white%0)  ) 
					( scatteri -0.02655 34.7, msymbol(o) color(blue) msize(medium))
					,
					graphregion(color(white))
					ylabel(-0.05(0.01)0.0 , /*glcolor(gs15) gmax gmin*/ nogrid)
					xlabel(0(25)100, nogrid glcolor(gs15))
					plotregion(margin(miniscule))
					xmtick(0(5)100)
					legend(off)
						
					text(  -0.022 0 "{stSerif: Empirical estimate with 95% CI}", place(e) color(gray))
					text(  -0.0295 33 "{stSerif:  EC = 34,700                                            }" "{stSerif: }", place(e) color(blue%80))
					xtitle("{stSerif:Monetary Entry Cost (NOK 1,000s)}")
					ytitle("{stSerif:Probability of Giving}")
					;
			#delimit cr
graph export ${outputfilepath}/wdon1_calibration_dP.pdf, as(pdf) replace
